export const status = new Map([
  ['1', '启用'],
  ['2', '禁用']
])

export const statusType = MapToArray(status)

export enum MenuTypeEnum {
  MENU = 1,
  BUTTON = 2
}
export const MenuType = new Map([
  [MenuTypeEnum.MENU, '菜单'],
  [MenuTypeEnum.BUTTON, '按钮'],
])
/**
 * 角色类型字典
 */
export const memberRoleMap = new Map([
  ['1', '户主'],
  ['2', '父亲'],
  ['3', '母亲'],
  ['4', '妻子'],
  ['5', '儿子'],
  ['6', '女儿'],
  ['20', '其他']
])

// 大户类型
export const LargeMemberTypeMap = new Map([
  ['1', '自然人'],
  ['4', '农场'],
  ['2', '合作社'],
  ['3', '公司'],
  ['9', '其他'],
])
export const LargeMemberType = MapToArray(LargeMemberTypeMap)

// 上传资源字典
export const AssetsTypeMap = new Map([
  // ['1', '行政地区'],
  ['2', '农户数据'],
  ['3', '家庭成员数据'],
  ['4', '补贴信息'],
])
export const AssetsType = MapToArray(AssetsTypeMap)

// 上传数据处理状态
export const DataHandlerTypeMap = new Map([
  ['0', '待办'],
  ['1', '等候入库'],
  ['2', '正在入库'],
  ['3', '入库成功'],
])
export const DataHandlerType = MapToArray(DataHandlerTypeMap)

// 补贴单位
export const PayUnitTypeMap = new Map([
  ['1', '种粮面积'],
  ['2', '耕地面积'],
  ['3', '二包面积'],
  ['4', '计税面积'],
  ['5', '确权面积'],
  // ['9', '其他面积']
])
export enum PayUnitTypeEnum {
  PLANT = '1',
  FIELD = '2',
  CONFIRM = '3',
  TAX = '4',
  CONFIRM_T = '5'
}
export const PayUnitType = MapToArray(PayUnitTypeMap)

// 公示状态
export enum publishStatusEnum {
  PUBLIC_ING = '0',
  PUBLIC_SUCCESS = '1',
  PUBLIC_CANCEL = '2',
  // PUBLIC_FAIL = '3',
  PUBLIC_WAIT = '4',
}
export const publishStatusMap = new Map([
  [publishStatusEnum.PUBLIC_ING, '公示中'],
  [publishStatusEnum.PUBLIC_SUCCESS, '公示通过'],
  [publishStatusEnum.PUBLIC_CANCEL, '撤销公示'],
  [publishStatusEnum.PUBLIC_WAIT, '待公示'],
  // [publishStatusEnum.PUBLIC_FAIL, '公示未通过']
])
export const publishStatus = MapToArray(publishStatusMap)

export const reviewMap = new Map([
  ['1', '情况属实'],
  ['2', '不属实']
])
export const reviewDict = MapToArray(reviewMap)

export function MapToArray(map: Map<string | number, string>): Array<{ value: string | number, label: string }> {
  return Array.from(map).map(item => {
    return {
      value: item["0"],
      label: item["1"]
    }
  })
}

export const memberRole = MapToArray(memberRoleMap)

/**
 * 在线状态字典
 */
export const onlineType = new Map([
  ['', '全部'],
  [0, '离线'],
  [1, '在线']
] as any)

/**
 * 用户状态字典
 */
export const userStatus = new Map([
  ['', '全部'],
  [1, '正常'],
  [-1, '禁用'],
] as any)

/**
 * 设备类型字典
 */
export const deviceType = new Map([
  ['Android', 'Android'],
  ['iOS', 'iOS'],
  ['PC', 'PC'],
  ['Mac', 'Mac'],
])

/**
 * 性别字典
 */
export const sexType = new Map([
  [1, '男'],
  [0, '女'],
])
